package com.thomasbrault.utils {	import flash.events.KeyboardEvent;		import flash.display.DisplayObject;			/**	 * @author thomasbrault	 */	public class KeyControl 	{				private var _controlList : Array;		private var _target : DisplayObject;		function KeyControl ( target : DisplayObject)		{			_controlList=new Array;			_target=target;			_target.addEventListener(KeyboardEvent.KEY_UP, _keyUp);		}				private function _keyUp(event : KeyboardEvent) : void		{			for ( var i in _controlList )			{				if ( _controlList[i].key == event.keyCode ) {					_controlList[i].action.apply(null);				}			}		}		public function addControl ( key : int, action : Function ) : void		{			_controlList.push({key: key,action : action});		}				public function dispose (  ) : void		{			_controlList=new Array;			_target.removeEventListener(KeyboardEvent.KEY_UP, _keyUp);			_target = null;		}	}}